if(xc_domain_memory_increase_reservation(
xc_handle, dom, max_pfn, 0, 0, NULL) != 0) {
- ERR("Failed to increase reservation by %lx KB\n", PFN_TO_KB(max_pfn));
+ ERR("Failed to increase reservation by %lx KB", PFN_TO_KB(max_pfn));
errno = ENOMEM;
goto out;
}
for(k = 0; k < j; k++) {
if(!uncanonicalize_pagetable(L1TAB,
region_base + k*PAGE_SIZE)) {
- ERR("failed uncanonicalize pt!\n");
+ ERR("failed uncanonicalize pt!");
goto out;
}
}
xmml.max_extents = m2p_chunks;
if (!(xmml.extent_start = malloc(m2p_chunks * sizeof(unsigned long)))) {
- ERR("failed to allocate space for m2p mfns!\n");
+ ERR("failed to allocate space for m2p mfns");
return NULL;
}
if (xc_memory_op(xc_handle, XENMEM_machphys_mfn_list, &xmml) ||
(xmml.nr_extents != m2p_chunks)) {
- ERR("xc_get_m2p_mfns:");
+ ERR("xc_get_m2p_mfns");
return NULL;
}
}
if (!(entries = malloc(m2p_chunks * sizeof(privcmd_mmap_entry_t)))) {
- ERR("failed to allocate space for mmap entries!\n");
+ ERR("failed to allocate space for mmap entries");
return NULL;
}
pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
if ((pfn_type == NULL) || (pfn_batch == NULL)) {
- ERR("failed to alloc memory for pfn_type and/or pfn_batch arays.");
+ ERR("failed to alloc memory for pfn_type and/or pfn_batch arrays");
errno = ENOMEM;
goto out;
}
#define PROGRESS 0
#define ERR(_f, _a...) do { \
- fprintf(stderr, _f "\n" , ## _a); \
+ fprintf(stderr, _f ": %d\n" , ## _a, errno);\
fflush(stderr); } \
while (0)